Skip to content

[bindings] Bug Fix: tweak and fix minor behavior in headers/bindings #1533

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 6, 2025

Conversation

kyleholohan
Copy link
Contributor

This PR fixes and tweaks a few things:

  • Fix attributes and SAL annotations and getpeername and getsockopt
  • Add a safety #pragma pack to types.h so we don't accidentally forget to restore packing for C clients
  • Fix error message wording to indicate the correct method
  • Stop tracing when a wait times out; this is not really an error condition
  • Be more permissive in allowing the client to pass overlarge buffers to getpeername

@kyleholohan kyleholohan added the bug Something Isn't Working label Apr 25, 2025
@kyleholohan kyleholohan self-assigned this Apr 25, 2025
Copy link

libos = catnap
commit id = 4cd15ef

collapsed_stack num_calls cycles_per_call nanoseconds_per_call total_duration percent_total_duration total_duration_exclusive percent_total_duration_exclusive
bgc::catnap::transport::epoll 6288638 3776 1589 2864842575 99 2864842575 99
ioc::network::libos::push 17610 469 193 7401090 0 7401090 0
ioc::network::libos::pop 14919 456 189 5423612 0 5423612 0
ioc::network::libos::connect 50 175900 71456 3449523 0 3449523 0
ioc::network::libos::accept 26 106635 44250 1353109 0 1353109 0
demikernel::sgaalloc 11287 115 47 1120847 0 1120847 0
demikernel::sgafree 11543 61 25 674550 0 674550 0
ioc::network::libos::close 18 22427 9259 335078 0 335078 0
ioc::network::libos::pushto 768 426 173 255485 0 255485 0

Copy link

libos = catnip
commit id = 4cd15ef

collapsed_stack num_calls cycles_per_call nanoseconds_per_call total_duration percent_total_duration total_duration_exclusive percent_total_duration_exclusive
bgc::inetstack::poll;inetstack::layer4::poll_once;catnip::runtime::receive 28689068 201 81 5502531488 19 5502531488 42
bgc::inetstack::poll;inetstack::layer4::poll_once 28689068 379 153 10231496638 36 4723668640 36
bgc::inetstack::poll 14344534 948 382 12948413675 45 2716917037 21
ioc::network::libos::push 16185 1095 449 17633658 0 15499431 0
bgc::inetstack::poll;inetstack::layer4::poll_once;inetstack::layer4::receive_batch 2588 3434 1358 5386282 0 5304537 0
bgc::inetstack::tcp::established::background;tcp::established::background::retransmitter 11230 324 131 4597095 0 4596078 0
bgc::inetstack::tcp::established::background;tcp::established::background::acknowledger 11242 420 173 2878199 0 2855995 0
ioc::network::libos::pop 9145 382 154 2814474 0 2814474 0
bgc::inetstack::tcp::established::background 11242 1170 474 10844219 0 2700819 0
ioc::network::libos::push;catnip::runtime::transmit 8777 311 127 2317161 0 2317161 0
ioc::network::libos::connect 42 32471 13036 1331650 0 1276735 0
demikernel::sgaalloc 6503 127 51 731241 0 731241 0
demikernel::sgafree 8759 86 35 657717 0 657717 0
bgc::inetstack::tcp::established::background;tcp::established::background::sender 11188 321 124 668106 0 657324 0
bgc::inetstack::tcp::passiveopen::background 42 26687 10973 662657 0 606739 0
ioc::network::libos::pushto 384 2203 914 563908 0 432663 0
bgc::inetstack::tcp::established::background;tcp::established::background::acknowledger;catnip::runtime::transmit 44 1411 607 138160 0 138160 0
ioc::network::libos::pushto;catnip::runtime::transmit 384 785 324 131245 0 131245 0
bgc::inetstack::poll;inetstack::layer4::poll_once;inetstack::layer4::receive_batch;catnip::runtime::transmit 219 764 308 83458 0 83458 0
ioc::network::libos::close 49 2513 1018 56781 0 56781 0
bgc::inetstack::tcp::passiveopen::background;catnip::runtime::transmit 21 15097 6233 55918 0 55918 0
ioc::network::libos::connect;catnip::runtime::transmit 42 5822 2303 54915 0 54915 0
ioc::network::libos::accept 37 2394 991 52809 0 52809 0
bgc::inetstack::poll;inetstack::layer4::poll_once;inetstack::layer4::receive_batch;udp::receive 222 285 119 49761 0 49761 0
bgc::inetstack::arp::background 7 3465 1402 24194 0 24194 0
bgc::inetstack::tcp::established::background;tcp::established::background::sender;catnip::runtime::transmit 21 611 247 10781 0 10781 0
bgc::inetstack::tcp::established::background;tcp::established::background::retransmitter;catnip::runtime::transmit 17 510 218 5696 0 5696 0
bgc::inetstack::icmp::background 1 1691 681 1866 0 1866 0

Copy link

libos = catpowder
commit id = 4cd15ef

collapsed_stack num_calls cycles_per_call nanoseconds_per_call total_duration percent_total_duration total_duration_exclusive percent_total_duration_exclusive
bgc::inetstack::poll;inetstack::layer4::poll_once 26500836 704 281 16938065631 46 16930828156 85
bgc::inetstack::poll 13250418 1624 648 19764515827 54 2826450196 14
ioc::network::libos::push 16316 3112 1259 51409968 0 51409968 0
bgc::inetstack::poll;inetstack::layer4::poll_once;inetstack::layer4::receive_batch 5461 2844 1106 7360144 0 7356017 0
bgc::inetstack::tcp::established::background;tcp::established::background::retransmitter 11234 437 174 5623965 0 5623965 0
ioc::network::libos::pop 9103 495 197 3857970 0 3857970 0
bgc::inetstack::tcp::established::background;tcp::established::background::acknowledger 11246 745 296 3448455 0 3448455 0
bgc::inetstack::tcp::established::background 11246 1947 767 13207460 0 3257677 0
ioc::network::libos::connect 42 40091 16088 1753264 0 1753264 0
ioc::network::libos::pushto 384 5235 2113 1746292 0 1746292 0
bgc::inetstack::tcp::passiveopen::background 42 30207 12012 1006573 0 1006573 0
demikernel::sgaalloc 6503 131 52 896892 0 896892 0
bgc::inetstack::tcp::established::background;tcp::established::background::sender 11190 941 359 877363 0 877363 0
demikernel::sgafree 8759 79 32 684263 0 684263 0
bgc::inetstack::poll;inetstack::layer4::poll_once;inetstack::layer4::receive_batch;udp::receive 330 262 103 81159 0 81159 0
ioc::network::libos::close 47 3106 1228 63807 0 63807 0
ioc::network::libos::accept 38 2219 887 51624 0 51624 0
bgc::inetstack::arp::background 10 2735 1088 23637 0 23637 0
bgc::inetstack::icmp::background 1 1918 760 2035 0 2035 0

@kyleholohan kyleholohan force-pushed the bugfix-bindings-headers branch 2 times, most recently from 96b4c50 to 2d11c15 Compare April 25, 2025 23:33
Copy link

libos = catnap
commit id = 2d11c15

collapsed_stack num_calls cycles_per_call nanoseconds_per_call total_duration percent_total_duration total_duration_exclusive percent_total_duration_exclusive
bgc::catnap::transport::epoll 6361506 3929 1664 2897405004 99 2897405004 99
ioc::network::libos::push 17610 482 256 7420402 0 7420402 0
ioc::network::libos::pop 14839 458 241 5362224 0 5362224 0
ioc::network::libos::connect 50 178781 74512 3605063 0 3605063 0
ioc::network::libos::accept 27 106874 55038 1324319 0 1324319 0
demikernel::sgaalloc 11287 117 48 1163312 0 1163312 0
demikernel::sgafree 11543 62 32 686539 0 686539 0
ioc::network::libos::close 18 23156 11304 344783 0 344783 0
ioc::network::libos::pushto 768 375 150 239006 0 239006 0

Copy link

libos = catpowder
commit id = 2d11c15

collapsed_stack num_calls cycles_per_call nanoseconds_per_call total_duration percent_total_duration total_duration_exclusive percent_total_duration_exclusive
bgc::inetstack::poll;inetstack::layer4::poll_once 25404076 705 284 16266809193 46 16261167347 85
bgc::inetstack::poll 12702038 1627 656 18977126163 54 2710316971 14
ioc::network::libos::push 16267 2810 1151 47452672 0 47452672 0
bgc::inetstack::poll;inetstack::layer4::poll_once;inetstack::layer4::receive_batch 5310 2716 1076 5737470 0 5735439 0
bgc::inetstack::tcp::established::background;tcp::established::background::retransmitter 11088 408 166 5188754 0 5188754 0
ioc::network::libos::pop 9048 453 182 3336104 0 3336104 0
bgc::inetstack::tcp::established::background;tcp::established::background::acknowledger 11101 787 329 3158547 0 3158547 0
bgc::inetstack::tcp::established::background 11101 1921 781 12217585 0 3027518 0
ioc::network::libos::connect 42 41108 16828 1735520 0 1735520 0
ioc::network::libos::pushto 384 5133 2026 1681329 0 1681329 0
bgc::inetstack::tcp::passiveopen::background 42 29155 11667 974370 0 974370 0
demikernel::sgaalloc 6503 164 67 879376 0 879376 0
bgc::inetstack::tcp::established::background;tcp::established::background::sender 11045 885 342 842766 0 842766 0
demikernel::sgafree 8759 87 35 655923 0 655923 0
ioc::network::libos::close 46 2482 1009 61415 0 61415 0
ioc::network::libos::accept 38 2328 936 53402 0 53402 0
bgc::inetstack::poll;inetstack::layer4::poll_once;inetstack::layer4::receive_batch;udp::receive 214 219 84 39945 0 39945 0
bgc::inetstack::arp::background 10 3237 1302 22654 0 22654 0
bgc::inetstack::icmp::background 1 1780 719 1911 0 1911 0

Copy link

libos = catnip
commit id = 2d11c15

collapsed_stack num_calls cycles_per_call nanoseconds_per_call total_duration percent_total_duration total_duration_exclusive percent_total_duration_exclusive
bgc::inetstack::poll;inetstack::layer4::poll_once;catnip::runtime::receive 28261951 201 79 5552219017 19 5552219017 42
bgc::inetstack::poll;inetstack::layer4::poll_once 28261951 378 149 10196125750 35 4638892480 36
bgc::inetstack::poll 14130975 943 373 13030785456 45 2834659705 22
ioc::network::libos::push 16186 1076 433 17417349 0 15253693 0
bgc::inetstack::poll;inetstack::layer4::poll_once;inetstack::layer4::receive_batch 2738 4033 1572 5099240 0 5084160 0
bgc::inetstack::tcp::established::background;tcp::established::background::retransmitter 11080 320 127 4422270 0 4420959 0
bgc::inetstack::tcp::established::background;tcp::established::background::acknowledger 11092 429 167 2841765 0 2822566 0
ioc::network::libos::pop 9042 369 145 2810244 0 2810244 0
bgc::inetstack::tcp::established::background 11092 1187 466 10693368 0 2759786 0
ioc::network::libos::push;catnip::runtime::transmit 8777 307 124 2349113 0 2349113 0
ioc::network::libos::connect 42 32642 13044 1360173 0 1302748 0
demikernel::sgaalloc 6503 135 54 740846 0 740846 0
demikernel::sgafree 8759 88 35 668113 0 668113 0
bgc::inetstack::tcp::established::background;tcp::established::background::sender 11038 330 127 669546 0 659115 0
bgc::inetstack::tcp::passiveopen::background 42 26539 10409 656972 0 605939 0
ioc::network::libos::pushto 384 2182 905 594077 0 432874 0
ioc::network::libos::pushto;catnip::runtime::transmit 384 844 347 161203 0 161203 0
bgc::inetstack::tcp::established::background;tcp::established::background::acknowledger;catnip::runtime::transmit 44 1966 806 119459 0 119459 0
ioc::network::libos::close 49 2539 1009 57478 0 57478 0
ioc::network::libos::connect;catnip::runtime::transmit 42 5709 2263 57425 0 57425 0
bgc::inetstack::tcp::passiveopen::background;catnip::runtime::transmit 21 14759 5713 51032 0 51032 0
bgc::inetstack::poll;inetstack::layer4::poll_once;inetstack::layer4::receive_batch;udp::receive 218 269 109 49692 0 49692 0
ioc::network::libos::accept 37 2305 908 48514 0 48514 0
bgc::inetstack::arp::background 7 3317 1312 20832 0 20832 0
bgc::inetstack::poll;inetstack::layer4::poll_once;inetstack::layer4::receive_batch;catnip::runtime::transmit 26 699 278 13225 0 13225 0
bgc::inetstack::tcp::established::background;tcp::established::background::sender;catnip::runtime::transmit 21 564 223 10432 0 10432 0
bgc::inetstack::tcp::established::background;tcp::established::background::retransmitter;catnip::runtime::transmit 16 659 277 7342 0 7342 0
bgc::inetstack::icmp::background 1 1767 699 1926 0 1926 0

Copy link

libos = catnap
commit id = 2d11c15

collapsed_stack num_calls cycles_per_call nanoseconds_per_call total_duration percent_total_duration total_duration_exclusive percent_total_duration_exclusive
bgc::catnap::transport::epoll 6391056 3545 1983 2906194322 99 2906194322 99
ioc::network::libos::push 17610 491 215 7456900 0 7456900 0
ioc::network::libos::pop 14953 457 197 5426839 0 5426839 0
ioc::network::libos::connect 50 172233 77901 3387297 0 3387297 0
ioc::network::libos::accept 26 107318 44206 1350300 0 1350300 0
demikernel::sgaalloc 11287 116 54 1145515 0 1145515 0
demikernel::sgafree 11543 64 28 680313 0 680313 0
ioc::network::libos::close 18 22936 9947 341010 0 341010 0
ioc::network::libos::pushto 768 410 163 307500 0 307500 0

Copy link

libos = catnap
commit id = 0bbd765

collapsed_stack num_calls cycles_per_call nanoseconds_per_call total_duration percent_total_duration total_duration_exclusive percent_total_duration_exclusive
bgc::catnap::transport::epoll 6372769 4107 1794 2904325412 99 2904325412 99
ioc::network::libos::push 17610 512 210 7965216 0 7965216 0
ioc::network::libos::pop 15094 491 203 5692044 0 5692044 0
ioc::network::libos::connect 50 184204 75347 3568201 0 3568201 0
ioc::network::libos::accept 26 126417 52638 1508705 0 1508705 0
demikernel::sgaalloc 11287 113 47 1136476 0 1136476 0
demikernel::sgafree 11543 83 34 705380 0 705380 0
ioc::network::libos::close 18 25206 10432 358644 0 358644 0
ioc::network::libos::pushto 768 363 144 238309 0 238309 0

Copy link

libos = catpowder
commit id = 0bbd765

collapsed_stack num_calls cycles_per_call nanoseconds_per_call total_duration percent_total_duration total_duration_exclusive percent_total_duration_exclusive
bgc::inetstack::poll;inetstack::layer4::poll_once 20134976 729 292 12652044146 46 12646401352 85
bgc::inetstack::poll 10067488 1674 672 14721833638 54 2069789492 14
ioc::network::libos::push 16255 2838 1148 48394461 0 48394461 0
bgc::inetstack::poll;inetstack::layer4::poll_once;inetstack::layer4::receive_batch 5315 2762 1087 5738435 0 5732372 0
bgc::inetstack::tcp::established::background;tcp::established::background::retransmitter 11085 422 169 5087151 0 5087151 0
ioc::network::libos::pop 9047 585 232 3430245 0 3430245 0
bgc::inetstack::tcp::established::background;tcp::established::background::acknowledger 11098 691 282 3136781 0 3136781 0
bgc::inetstack::tcp::established::background 11098 1870 749 12133582 0 3063248 0
ioc::network::libos::connect 42 40839 16430 1763222 0 1763222 0
ioc::network::libos::pushto 384 5426 2149 1697338 0 1697338 0
demikernel::sgaalloc 6503 161 64 1002976 0 1002976 0
bgc::inetstack::tcp::passiveopen::background 42 30076 11979 999893 0 999893 0
bgc::inetstack::tcp::established::background;tcp::established::background::sender 11042 964 378 846402 0 846402 0
demikernel::sgafree 8759 89 35 631580 0 631580 0
bgc::inetstack::poll;inetstack::layer4::poll_once;inetstack::layer4::receive_batch;udp::receive 348 313 123 119223 0 119223 0
ioc::network::libos::close 47 2893 1145 66594 0 66594 0
ioc::network::libos::accept 39 2374 942 58332 0 58332 0
bgc::inetstack::arp::background 8 3184 1272 16823 0 16823 0
bgc::inetstack::icmp::background 1 1936 775 2085 0 2085 0

Copy link
Contributor

@iyzhang iyzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

@iyzhang iyzhang force-pushed the bugfix-bindings-headers branch from 0bbd765 to 4ed599e Compare May 6, 2025 20:15
Copy link

github-actions bot commented May 6, 2025

libos = catnap
commit id = 4ed599e

collapsed_stack num_calls cycles_per_call nanoseconds_per_call total_duration percent_total_duration total_duration_exclusive percent_total_duration_exclusive
bgc::catnap::transport::epoll 6371663 3575 1502 2910898980 99 2910898980 99
ioc::network::libos::push 17610 507 211 7914512 0 7914512 0
ioc::network::libos::pop 15126 479 199 5505604 0 5505604 0
ioc::network::libos::connect 50 181312 76444 3714300 0 3714300 0
ioc::network::libos::accept 26 138606 56939 1719142 0 1719142 0
demikernel::sgaalloc 11287 111 47 1108439 0 1108439 0
demikernel::sgafree 11543 70 29 700099 0 700099 0
ioc::network::libos::close 18 26052 10838 372554 0 372554 0
ioc::network::libos::pushto 768 461 185 251453 0 251453 0

Copy link

github-actions bot commented May 6, 2025

libos = catpowder
commit id = 4ed599e

collapsed_stack num_calls cycles_per_call nanoseconds_per_call total_duration percent_total_duration total_duration_exclusive percent_total_duration_exclusive
bgc::inetstack::poll;inetstack::layer4::poll_once 19976642 687 279 12525363397 46 12515589460 85
bgc::inetstack::poll 9988321 1587 643 14667484129 54 2142120732 15
ioc::network::libos::push 16255 3012 1247 52529030 0 52529030 0
bgc::inetstack::poll;inetstack::layer4::poll_once;inetstack::layer4::receive_batch 5903 3174 1244 9939596 0 9937224 0
bgc::inetstack::tcp::established::background;tcp::established::background::retransmitter 11646 508 205 5616856 0 5616856 0
ioc::network::libos::pop 9238 437 176 3806159 0 3806159 0
bgc::inetstack::tcp::established::background;tcp::established::background::acknowledger 11660 890 349 3529183 0 3529183 0
bgc::inetstack::tcp::established::background 11660 1787 710 13495420 0 3443597 0
ioc::network::libos::pushto 384 5727 2396 1885083 0 1885083 0
ioc::network::libos::connect 42 42240 17426 1819580 0 1819580 0
demikernel::sgaalloc 6503 143 60 1007946 0 1007946 0
bgc::inetstack::tcp::passiveopen::background 42 29217 11551 994047 0 994047 0
bgc::inetstack::tcp::established::background;tcp::established::background::sender 11660 105 42 905784 0 905784 0
demikernel::sgafree 8759 79 32 694905 0 694905 0
ioc::network::libos::close 46 5110 2072 183712 0 183712 0
ioc::network::libos::accept 38 2644 1055 57514 0 57514 0
bgc::inetstack::poll;inetstack::layer4::poll_once;inetstack::layer4::receive_batch;udp::receive 246 234 95 46645 0 46645 0
bgc::inetstack::arp::background 8 3154 1272 17365 0 17365 0
bgc::inetstack::icmp::background 1 1823 736 1984 0 1984 0

Copy link

github-actions bot commented May 6, 2025

libos = catnip
commit id = 4ed599e

collapsed_stack num_calls cycles_per_call nanoseconds_per_call total_duration percent_total_duration total_duration_exclusive percent_total_duration_exclusive
bgc::inetstack::poll;inetstack::layer4::poll_once;catnip::runtime::receive 28226807 205 82 5547947415 19 5547947415 43
bgc::inetstack::poll;inetstack::layer4::poll_once 28226807 401 159 10200406111 36 4646852650 36
bgc::inetstack::poll 14113404 997 396 12862026233 45 2661620122 21
ioc::network::libos::push 16185 1205 488 19620529 0 17232332 0
bgc::inetstack::poll;inetstack::layer4::poll_once;inetstack::layer4::receive_batch 2338 3568 1399 5701064 0 5686013 0
bgc::inetstack::tcp::established::background;tcp::established::background::retransmitter 11055 351 140 4572563 0 4571675 0
bgc::inetstack::tcp::established::background;tcp::established::background::acknowledger 11066 451 182 2977302 0 2958653 0
ioc::network::libos::pop 9042 400 159 2906630 0 2906630 0
bgc::inetstack::tcp::established::background 11066 1162 465 11037560 0 2760651 0
ioc::network::libos::push;catnip::runtime::transmit 8777 345 140 2592899 0 2592899 0
ioc::network::libos::connect 42 40576 16111 1687529 0 1622167 0
demikernel::sgaalloc 6503 145 59 741974 0 741974 0
bgc::inetstack::tcp::established::background;tcp::established::background::sender 11066 102 41 727045 0 727045 0
demikernel::sgafree 8759 84 33 686865 0 686865 0
bgc::inetstack::tcp::passiveopen::background 42 26999 10820 643774 0 588582 0
ioc::network::libos::pushto 384 2108 866 572209 0 441854 0
bgc::inetstack::tcp::established::background;tcp::established::background::acknowledger;catnip::runtime::transmit 54 1756 732 149193 0 149193 0
ioc::network::libos::pushto;catnip::runtime::transmit 384 758 308 130355 0 130355 0
ioc::network::libos::close 49 3963 1598 95849 0 85182 0
ioc::network::libos::connect;catnip::runtime::transmit 42 7554 3045 65362 0 65362 0
bgc::inetstack::tcp::passiveopen::background;catnip::runtime::transmit 21 16500 6707 55192 0 55192 0
ioc::network::libos::accept 37 2312 929 51644 0 51644 0
bgc::inetstack::poll;inetstack::layer4::poll_once;inetstack::layer4::receive_batch;udp::receive 227 245 98 49793 0 49793 0
bgc::inetstack::arp::background 7 3697 1465 23146 0 23146 0
bgc::inetstack::poll;inetstack::layer4::poll_once;inetstack::layer4::receive_batch;catnip::runtime::transmit 26 741 299 13189 0 13189 0
ioc::network::libos::close;catnip::runtime::transmit 21 650 259 11428 0 11428 0
bgc::inetstack::tcp::established::background;tcp::established::background::retransmitter;catnip::runtime::transmit 15 1486 618 7101 0 7101 0
bgc::inetstack::icmp::background 1 1807 720 2002 0 2002 0

@iyzhang iyzhang merged commit f60aefe into dev May 6, 2025
14 checks passed
@iyzhang iyzhang deleted the bugfix-bindings-headers branch May 6, 2025 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something Isn't Working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants